<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
$arrID = explode(",", $_data["ID"]);
$arrIDs = array();
foreach($arrID as $intID){
	$arrIDs[] = (int)$intID;
}
if(sizeof($arrIDs) == 0){
	header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List&Page=".(string)intval($_data["Page"]));
	exit();
}

$strSQL = "select * from `bet_SelectGambleType` where ID in (".implode(",", $arrIDs).")";
if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = "Find SelectGambleType Data Error!!";
	$GLOBALS["errorhidden"] = "\n<!-- Error: ".PMA_mysql_error($$_Conn).",\nLine: ".__LINE__.",\nPage: ".__FILE__." //-->";
	ErrMsgOutputHTML("Error", "", 1);
}

if(PMA_mysql_num_rows($RS) == 0){
	header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List&Page=".(string)intval($_data["Page"]));
	exit();
}

$fp = @file($strTemplatePath."Edit.html");
$fp = implode("", $fp);
$fp = setHTMLCharset($fp);
$fp = str_replace("{Page}", $_data["Page"], $fp);

$strCon = "";
$strTmp = "";
preg_match("/<!-- @ Content Start @ \/\/-->(.+)<!-- @ Content End @ \/\/-->/s", $fp, $arrCon);
while($Rows = PMA_mysql_fetch_object($RS)){
	$strTmp = $arrCon[1];
	
	$strTmp = str_replace("{ShowID}", $Rows -> ID, $strTmp);
	$strTmp = str_replace("{ShowLType}", $_arrLType[$Rows -> LType], $strTmp);
	$strTmp = str_replace("{ShowBetType}", $_arrBet_Type[$Rows -> LType][$Rows -> BetType], $strTmp);
	$strTmp = str_replace("{ShowApoint}", $_strSelectGLine["ApointNumTip"][$Rows -> LType][$Rows -> BetType][$Rows -> ApointNum], $strTmp);
	$strTmp = str_replace("{ShowALine}", $Rows -> ALine, $strTmp);
	$strTmp = str_replace("{ShowBLine}", $Rows -> BLine, $strTmp);
	$strTmp = str_replace("{ShowCLine}", $Rows -> CLine, $strTmp);
	$strCon .= $strTmp."\n";

}
$fp = preg_replace("/<!-- @ Content Start @ \/\/-->.+<!-- @ Content End @ \/\/-->/s", $strCon, $fp);

while(list($k, $v) = each($_strSelectGLine)){
	$fp = str_replace("{".$k."}", $v, $fp);
}

//輸出
WebOutputHTML($fp, 1);
?>